﻿package lib;

import haxe.macro.Context;

class Build {
	// This macro generates code using Context.parse()
	public static macro function buildCode() {
		var buildTime = Math.floor(Date.now().getTime() / 1000);
		var e = "trace";
		var code = '{
      var runTime = Math.floor(Date.now().getTime() / 1000);
      var age = runTime - $buildTime;
      $e("Right now it\'s "+runTime+", and this build is "+age+" seconds old");
    }';

		return Context.parse(code, Context.currentPos());
	}
}
